package ch.zbw.timeline.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

import lombok.Data;

/**
 * Domain class for an overtime pool
 */
@Entity
@SequenceGenerator(name = "id_overtime_pool", initialValue = 1, allocationSize = 1)
@Table(name = "overtime_pool")
@Data
public class OverTimePool implements Serializable {

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id_overtime_pool", nullable = false)
	private int id;

	@Column(name = "number_of_hours", nullable = true)
	private double numberOfHours;

	@Column(name = "description", nullable = true)
	private String description;

	@Column(name = "fk_user", nullable = true)
	private Integer employeeFk;

	@Transient
	private Employee employee;

	public OverTimePool() {
	}

	public OverTimePool(double numberOfHours, String description,
			Integer employeeFk) {
		this.numberOfHours = numberOfHours;
		this.description = description;
		this.employeeFk = employeeFk;
	}
}
